const http = require("http");

const server = http.createServer((req, resp) => {
  console.log(req.url);
  resp.setHeader("Content-Type", "text/html;charset=utf-8");
  if (req.url == "/login") {
    resp.write("登录成功!");
  }l

  if (req.url == "/reg") {
    resp.write("注册成功!");
  }
  resp.end();
});

server.listen(8080, () => {
  console.log("服务器,启动完毕!");
});